|
|
|
|
|
|
|
Instead you can use the corresponding scaling matrix. For example, to create a matrix representing a reflection across the X-Y plane, you can write: |
|
|
|
 |
|
|
|
|
Dim M(1 To 4, 1 To 4) As Single
m3Scale M, 1, 1, -1 |
|
|
|
|
|
|
|
|
If you keep the standard arrangement of the X and Y axes in two dimensions, you can add the Z axis in two possible ways. If you think of the X-Y plane as lying parallel to the surface of this page, the Z axis could point into or out of the page. These different choices are called right-handed and left-handed coordinate systems, respectively, because you can use your hands to remember how the axes are related. |
|
|
|
|
|
|
|
|
If you point your right thumb along the Z axis in the positive direction in a right-handed coordinate system, your fingers curl in the direction leading from the X axis toward the Y axis. If you point your left thumb along the Z axis in the positive direction in a left-handed coordinate system, your fingers also curl in the direction leading from the X axis toward the Y axis. Figure 13.1 shows right- and left-handed coordinate systems. |
|
|
|
|
|
|
|
|
When you translate or scale an object, you do not need to think too much about the exact arrangement of the coordinate axes. When you rotate an object, however, you need to decide whether you are working in a right- or left-handed coordinate system. Some authors use left-handed systems and some use right-handed systems. The right-handed system seems to be more common, so it is the one used here. |
|
|
|
|
|
|
|
|
Different authors also measure angles of rotation in different directions. Some measure angles clockwise as you look down an axis toward the origin, and others measure them counterclockwise. Counterclockwise angles seem to be more common, so they are used in this book. |
|
|
|
|
|
|
|
|
Counterclockwise angles have the additional advantage that rotating around the Z axis agrees with rotation in two dimensions. If you look down the positive Z-axis toward the origin, angles increase as you rotate from the positive X axis toward the positive Y axis. |
|
|
|
|
|
|
|
|
Figure 13.1
Right- and left-handed coordinate systems. |
|
|
|
|
|